function check() {
    var usern = $("#username").val();
    var userp = $("#userpwd").val();
    var userp1 = $("#userpwd1").val();
    var eml    = $("#email").val();
    var uncheck = /^[a-zA-Z][a-zA-Z0-9]*$/;
    var emailcheck=/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
    var flag = true;
    
    if(usern==null||usern==""){
        alert("账号不能为空");
        flag = false;
    }else if(usern.length<6||usern.length>16){
        alert("账号长度为6到16");
        flag = false;
    }else if(!(uncheck.test(usern))){
        alert("账号只能由以及数字和字母组成,且必须以字母开头");
        flag = false;
    }else if(userp==null||userp==""){
        alert("密码不能为空");
        flag = false;
    }else if(userp.length<6||userp.length>20){
        alert("密码长度为6到20");
    }else if(userp!=userp1){
        alert("两次输入的密码不一样");
        flag = false;
    }else if(!(emailcheck.test(eml))){
        alert("邮箱不正确");
        flag = false;
    }
    return flag;
}